<?php
class ome_system_setting{
    public function view(){
        $settings = $this->all_settings();
        foreach($settings as $set){
            $key = str_replace('.','_',$set);
            $setData[$key] = &app::get('ome')->getConf($set);
        }

        $render = kernel::single('base_render');
        $render->pagedata['setData'] = $setData;
        $render->pagedata['branchCount'] = $this->getBranchMode();

        $html = $render->fetch('admin/system/setting.html','ome');
        return $html;
    }

    public function all_settings(){
        $all_settings =array(
                  'ome.branch.mode',
                  //'ome.order.split_type',
                  'ome.order.failtime',
                  'ome.delivery.check',
        		  'ome.api_log.clean_time',
                  'ome.order.unconfirmtime',
                  'ome.delivery.consign',
                  'ome.delivery.check_type',
                  'ome.delivery.check_show_type',
				  'ome.batch_print_nums',
        		  'ome.delivery.check_ident',
                );
        return $all_settings;
    }

  	public function getBranchMode(){
		$oBranch = app::get('ome')->model('branch');
		$con = count( $oBranch->Get_branchlist());
		return $con;
	}
}
